#pragma once
#include <cassert>
#include <typeinfo>

namespace HFSME {



typedef int EventId;

struct HEventBase{
	static int maxEventId;
	virtual ~HEventBase(){}
	virtual EventId& getEventTypeId()=0;
};

template<typename T>
struct HEvent:HEventBase
{
	static EventId theEventTypeId;
	virtual EventId& getEventTypeId()
	{
		return theEventTypeId;
	}
};

template <typename T> EventId HEvent<T>::theEventTypeId(-1);


/*
//
//#define IMPLEMENT_INDEXABLE_CLASS(Event)    static int&getStaticEventId(void )\
//											{ \
//												static int eventId=-1; \
//												return eventId;\
//											}\
//											virtual int& getEventId(void)\
//											{\
//												assert(typeid(*this)==typeid(Event) && "You need to put IMPLEMENT_INDEXABLE_CLASS() on each event class");\
//												return getStaticEventId();\
//											}

*/


}  // namespace hfsme
